import unittest

import numpy

import wlc
import discrete_wlc

class DiscreteWlcTest(unittest.TestCase):

    def test_wlc_force(self):
        kb_t_over_p = 2.0
        v_over_lc = 5.0
        k_lc = 4.0
        for y in numpy.arange(100.0):
            t = wlc.f_inverse(kb_t_over_p, k_lc, v_over_lc, y)
            actual = discrete_wlc.wlc_force(kb_t_over_p, k_lc, v_over_lc * t)
            self.assertAlmostEqual(y, actual)
        #x_over_lc = v_over_lc * t - y / k_lc
        #actual = wlc(kb_t_over_p, x_over_lc)
        #numpy.testing.assert_almost_equal(y, actual)
        

if __name__ == "__main__":
    suite = unittest.TestLoader().loadTestsFromTestCase(DiscreteWlcTest)
    unittest.TextTestRunner(verbosity=2).run(suite)
    # unittest.main() 
